package main

import (
	"context"
	"flag"
	"go.uber.org/zap"
	"gsms/internal/conf"
	"gsms/internal/dao"
	"gsms/internal/model"
	"gsms/pkg/mcontext"
)

func main() {
	flag.Parse()
	ctx := context.Background()
	log := mcontext.Logger(ctx)
	if err := conf.Init(); err != nil {
		log.Panic("initial config failed", zap.Error(err))
	}
	d := dao.New(conf.Conf)
	log.Info("db migration in progress ...")
	_ = d.DB.AutoMigrate(&model.SmsVerify{})
	_ = d.DB.AutoMigrate(&model.SmsHistory{})
	log.Info("db migration finished.")
}

